package design.onekey.controller;

import design.onekey.base.Response;
import design.onekey.model.dto.UserInfoDto;
import design.onekey.model.UserAccount;
import design.onekey.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * @ClassName: LoginController
 * @Description: 登录用controller
 * @author blcloak
 * @date 2020-06-05 10:53:53
*/
@RestController
@RequestMapping("/api/login")
public class LoginController {

	@Autowired
	private ILoginService iLoginService;

	/**
	 * @Title: doLogin
	 * @Description: 用户登录
	 * @param userAccount
	 * @return
	 * @author blcloak
	 * @date 2020-06-12 01:20:05
	 */
	@RequestMapping(value = "/doLogin",method = RequestMethod.POST)
	public Response doLogin(@RequestBody UserAccount userAccount) {
		UserInfoDto result = iLoginService.doLogin(userAccount);
		return Response.success(result);
	}

 }
